# Python IO流
import os
import shutil

try:
    user_io = open("user_info.properties", 'r+', encoding='utf-8')
    write = open('copy.txt', 'a+', encoding='utf-8')
    # 按行读取
    readline = user_io.readline()
    while readline is not None and readline.strip() != '':
        # 打印
        print(readline, '')
        readline = user_io.readline()
        # 输出到copy.txt
        write.write(readline)
        write.flush()
except:
    print("文件读取失败")
finally:
    write.close()
    user_io.close()

# 删除文件
is_exists = os.path.exists('copy.txt')
if is_exists: os.remove("copy.txt")
